// 生成当地时间的方法文件
export const getTime = function () {
  const now = new Date()
  const y = now.getFullYear()
  let month = now.getMonth() + 1
  let day = now.getDate()
  let hour = now.getHours()
  let minutes = now.getMinutes()
  let seconds = now.getSeconds()
  month = month < 10 ? '0' + month : month
  day = day < 10 ? '0' + day : day
  hour = hour < 10 ? '0' + hour : hour
  minutes = minutes < 10 ? '0' + minutes : minutes
  seconds = seconds < 10 ? '0' + seconds : seconds
  return {
    orderCode: y.toString() + month.toString() + day + hour + minutes + seconds + (Math.round(Math.random() * 1000000)).toString(),
    orderTime: `${y}-${month}-${day} ${hour}:${minutes}:${seconds}`
  }
}
